a = int(input())
max=a
min=a
while a!=0:
    a=int(input())
    if a==0:
        break 
    if a<min:
        min=a
    if a>max:
        max=a
print(max-min)
